package tripService;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;

import tripModel.Note;

public class NoteService {
	public static final int pageSize = 6;

	public static final List<Note> findNotesByLID(long lID) {
		return Note.dao.find("select nID,nTitle,nCreateDate,nUID,nCID,nIntro from note where nLID=?", lID);
	}

	public static final Note findNoteByNid(Long nID) {
		return Note.dao.findByIdLoadColumns(nID, "nID,nTitle,nCreateDate,nUID,nCID,nIntro,nContent");
	}

	public static final Page<Note> getNotes(int pageNumber) {
		return Note.dao.paginate(pageNumber, pageSize, "select nID,nTitle,nCreateDate,nUID,nCID,nIntro", "from note");
	}
}
